package com.njtoyo.taxi.admin.rest.controller.business;


import com.njtoyo.taxi.admin.rest.wrapper.business.ride.CallWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.business.ride.CallWrapperDto;
import com.njtoyo.taxi.admin.service.business.SimpleCallService;
import com.njtoyo.taxi.entity.backend.AdminUser;
import com.taxi.entity.common.RestResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;


@RestController
@RequestMapping("business/simple-call")
public class SimpleCallController {

    @Autowired
    private SimpleCallService simpleCallService;




    @GetMapping("/list")
    RestResult simpleCallList(@ApiIgnore @ModelAttribute("admin") AdminUser adminUser,@Valid CallWrapper wrapper) {
        return simpleCallService.getPageList(adminUser, wrapper);
    }

    @GetMapping("/listExport")
    @ApiOperation(value = "一键叫车列表导出")
    public void simpleCallListExport(@ApiIgnore @ModelAttribute("admin") AdminUser adminUser,
                                     @Valid CallWrapperDto wrapper,
                                     HttpServletResponse response) throws IOException {
        simpleCallService.simpleCallListExport(adminUser, wrapper, response);
    }
}
